import request from '@/utils/request'
export const sysRoleListRequest = ({ page, pagesize }) => request.get('/sys/role', { params: { page, pagesize }})
export const addRoleListRequest = ({ name, description, state }) => request.post('/sys/role', { name, description, state })
export const deleteRoleListRequest = (id) => request.delete(`/sys/role/${id}`)
export const upadteRoleListRequest = ({ id, name, description, state }) => request.put(`/sys/role/${id}`, { id, name, description, state })
// 获得已启用的接口
export const roleEnabledListRequest = () => request.get(`/sys/role/list/enabled`)
// 获得权限关联
export const getRoleDetailRequest = (id) => request.get(`/sys/role/${id}`)
export const assignPremRequest = ({ id, permIds }) => request.put(`/sys/role/assignPrem`, { id, permIds })
